package com.pansoft.hd;

/**
 * HD钱包加密货币类型
 * Created by yqs97.
 * Date: 2019/10/30
 * Time: 20:52
 */
public enum HDChainType {
    Bitcoin(0, "BTC"),
    BitcoinTest(1, "BTC"),
    Litecoin(2, "LTC"),
    Dogecoin(3, "DOGE"),
    Ethereum(60, "ETH"),
    EOS(194, "EOS");
    private int coinType;
    private String coinName;

    HDChainType(int i, String name) {
        coinType = i;
        coinName = name;
    }

    public int coinType() {
        return coinType;
    }

    public String coinName() {
        return coinName;
    }

    public static HDChainType parseCoinType(int type) {
        for (HDChainType e : HDChainType.values()) {
            if (e.coinType == type) {
                return e;
            }
        }

        return null;
    }

}
